package cn.fzhui;

/**
 * 套餐
 * 通话时长、短信条数、每月资费
 */
public class CallPackageImpl extends Package implements CallServiceInterface {

    // 通话时长
    private double lengthOfCall;

    // 短信条数
    private int numberOfSms;

    public double getLengthOfCall() {
        return lengthOfCall;
    }

    public void setLengthOfCall(double lengthOfCall) {
        this.lengthOfCall = lengthOfCall;
    }

    public int getNumberOfSms() {
        return numberOfSms;
    }

    public void setNumberOfSms(int numberOfSms) {
        this.numberOfSms = numberOfSms;
    }

    public CallPackageImpl() {
    }

    /**
     * 有参构造
     *
     * @param lengthOfCall
     * @param numberOfSms
     */
    public CallPackageImpl(double lengthOfCall, int numberOfSms) {
        this.lengthOfCall = lengthOfCall;
        this.numberOfSms = numberOfSms;
    }

    /**
     * 显示短信套餐信息
     */
    public void display() {
        System.out.println("通话时长：" + this.lengthOfCall);
        System.out.println("短信条数：" + this.numberOfSms);
        System.out.println("每月资费：" + this.tariff);
    }

    @Override
    public void call(int minute, Card card) {
        System.out.println("电话卡号：" + card.getNumber() + "使用了通话服务" + minute + "分钟。");
    }
}
